package algorithm.weightgraph;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Edge<Weight extends Number & Comparable> implements Comparable<Edge<Weight>> {

    private int s;

    private int e;

    private Weight weight;

    public int other(int p){
        return p==s?e:s;
    }

    @Override
    public int compareTo(Edge<Weight> other) {
        return this.weight.compareTo(other.weight);
    }
}
